/**
 * 
 */
package br.com.ctm.guiamedico.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.xml.bind.annotation.XmlRootElement;

import br.com.framework.persistencia.model.AuditedEntity;

/**
 * @author Cleber
 * 
 */
@Entity
@Table(name = "VERSAO")
@XmlRootElement
public class Versao extends AuditedEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Long numero;

	/**
	 * 
	 */
	public Versao() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_VERSAO")
	@SequenceGenerator(name = "SEQ_VERSAO", sequenceName = "SEQ_VERSAO", allocationSize = 1, initialValue = 0)
	@Column(name = "ID_VERSAO")
	public Long getId() {
		return super.getId();
	}

	/**
	 * @return the numero
	 */
	@Column(name = "NUMERO", nullable = false)
	@Min(value = 1, message = "{geral.campo.valorMinimo}")
	public Long getNumero() {
		return numero;
	}

	/**
	 * @param numero
	 *            the numero to set
	 */
	public void setNumero(Long numero) {
		this.numero = numero;
	}

}
